package com.ruoyi.redtea.dualprevent.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 隐患整改，由隐患排查项上报而来，既是任务整改本体也充当流程节点“上报”
 * @TableName train_trouble_rectify
 */
@TableName(value ="train_trouble_rectify")
@Data
public class TrainTroubleRectify implements Serializable {
    /**
     * 
     */
    @TableId
    private Integer id;

    /**
     * 做排查项记录的id
     */
    private Integer troubleItemNoteId;

    /**
     * 整改任务状态；1.待处理  2.已处理 3.已超期
     */
    private Integer rectifyTaskStatus;

    /**
     * 下一流程人员id，判断权限用与具体流程存储的不冲突
     */
    private String nextPerson;

    /**
     * 上报人
     */
    private String reportPerson;

    /**
     * 步骤；0-上报 1-评估 2-整改 3-作业中 4-验收 完成才改变状态
     */
    private Integer processStep;

    /**
     * 0-限时整改 1-立即整改
     */
    private Integer troubleType;

    /**
     * 
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 
     */
    @JsonFormat
    private Date createTime;

    /**
     * 1：删除  0：未删除
     */
    private Integer isdel;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TrainTroubleRectify other = (TrainTroubleRectify) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTroubleItemNoteId() == null ? other.getTroubleItemNoteId() == null : this.getTroubleItemNoteId().equals(other.getTroubleItemNoteId()))
            && (this.getRectifyTaskStatus() == null ? other.getRectifyTaskStatus() == null : this.getRectifyTaskStatus().equals(other.getRectifyTaskStatus()))
            && (this.getNextPerson() == null ? other.getNextPerson() == null : this.getNextPerson().equals(other.getNextPerson()))
            && (this.getReportPerson() == null ? other.getReportPerson() == null : this.getReportPerson().equals(other.getReportPerson()))
            && (this.getProcessStep() == null ? other.getProcessStep() == null : this.getProcessStep().equals(other.getProcessStep()))
            && (this.getTroubleType() == null ? other.getTroubleType() == null : this.getTroubleType().equals(other.getTroubleType()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getIsdel() == null ? other.getIsdel() == null : this.getIsdel().equals(other.getIsdel()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTroubleItemNoteId() == null) ? 0 : getTroubleItemNoteId().hashCode());
        result = prime * result + ((getRectifyTaskStatus() == null) ? 0 : getRectifyTaskStatus().hashCode());
        result = prime * result + ((getNextPerson() == null) ? 0 : getNextPerson().hashCode());
        result = prime * result + ((getReportPerson() == null) ? 0 : getReportPerson().hashCode());
        result = prime * result + ((getProcessStep() == null) ? 0 : getProcessStep().hashCode());
        result = prime * result + ((getTroubleType() == null) ? 0 : getTroubleType().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getIsdel() == null) ? 0 : getIsdel().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", troubleItemNoteId=").append(troubleItemNoteId);
        sb.append(", rectifyTaskStatus=").append(rectifyTaskStatus);
        sb.append(", nextPerson=").append(nextPerson);
        sb.append(", reportPerson=").append(reportPerson);
        sb.append(", processStep=").append(processStep);
        sb.append(", troubleType=").append(troubleType);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", isdel=").append(isdel);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}